<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%
	response.setHeader("Pragma", "No-cache");
	response.setHeader("Cache-Control", "no-cache");
	response.setDateHeader("Expires", 0);
	String themePath = "UI";
%>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>BASD统一框架</title>
	<link href="<%=request.getContextPath()%>/resources/<%=themePath%>/css/framework.css" rel="stylesheet" type="text/css" />
	<link href="<%=request.getContextPath()%>/resources/<%=themePath%>/css/rightmenu.css" rel="stylesheet" type="text/css" />
	<script src="<%=request.getContextPath()%>/js/system/jquery.min.js" type="text/javascript"></script>
	<script src="<%=request.getContextPath()%>/js/system/system.js" type="text/javascript"></script>
	<script src="<%=request.getContextPath()%>/js/plugins/autocomplete.js" type="text/javascript"></script>
	<script src="<%=request.getContextPath()%>/js/plugins/tabScript_jsa.js" type="text/javascript"></script>
	<script src="<%=request.getContextPath()%>/js/plugins/MzTreeView12.js" type="text/javascript"></script>
	<script src="<%=request.getContextPath()%>/js/plugins/cookieSave.js" type="text/javascript"></script>
</head>
<body id="main_page">
	<!--ScreenLock begin-->
	<div id="lock" style="width: 100%; height: 100%; background: silver; position: absolute; top: -100%; left: 0; z-index: 10002;">
		<iframe width="100%" height="100%" frameborder="0"></iframe>
		<div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #237EAB;"></div>
	</div>
	<!--ScreenLock end-->

	<!--topPanel begin-->
		<%@ include file="topPanel.jsp"%>
	<!--topPanel end-->
	
	<!--searchPanel begin-->
		<%@ include file="searchPanel.jsp"%>
	<!--searchPanel end-->

	<!--ContentArea bengin-->
	<div id="contentPanel">

		<!--navPanel begin-->
			<%@ include file="navPanel.jsp"%>
		<!--navPanel end-->

		<!--workPanel begin-->
			<%@ include file="workPanel.jsp"%>
		<!--workPanel end-->

	</div>

	<!--footPanel begin-->
	<%@ include file="footPanel.jsp"%>
	<!--footPanel end-->

	<!--防止页面另存-->
	<noscript>
		<iframe src="*.htm"></iframe>
	</noscript>
	<div id="currUserId" style="display: none"></div>

	<script language="javascript" type="text/javascript">
		/**************来自原来framework.js的代码*********/
// 整体布局
function layoutSwitch(n){
		
	$("#layoutStatus").val(n);
	
	$("#a1").attr("class","aSpace");
	$("#a2").attr("class","bSpace");
	$("#a3").attr("class","cSpace");
	$("#a4").attr("class","dSpace");
	
	
	if (n==1){//工作区最大化
		$("#navPanel").hide();
		$("#topPanel").hide();	
		$("#workPanel").css("margin-left","4px");
		$("#a1").attr("class","aSpaceOn");
	}
	if(n==2){//恢复完整视图
		$("#topPanel").show();
		$("#navPanel").show();
		$("#workPanel").css("margin-left","201px");
		$("#a2").attr("class","bSpaceOn");
	}
	if(n==3){//隐藏topPanel面板
		$("#topPanel").hide();
		$("#navPanel").show();
		$("#workPanel").css("margin-left","201px");
		$("#a3").attr("class","cSpaceOn");
	}
	if(n==4){//隐藏navPanel面板
		$("#topPanel").show();
		$("#navPanel").hide();
		$("#workPanel").css("margin-left","4px");
		$("#a4").attr("class","dSpaceOn");
	}
	
	initPanel(n);
}

function initPanel(n){	
	
	var marginHeight=9;
	if(n==1){
		$("#contentPanel").height($("body").height()-$("#searchPanel").height()-$("#footPanel").height()-marginHeight);	
	}else if(n==2){
		$("#contentPanel").height($("body").height()-$("#topPanel").height()-$("#searchPanel").height()-$("#footPanel").height()-marginHeight);	
	}else if(n==3){
		$("#contentPanel").height($("body").height()-$("#searchPanel").height()-$("#footPanel").height()-marginHeight);	
	}else if(n==4){
		$("#contentPanel").height($("body").height()-$("#topPanel").height()-$("#searchPanel").height()-$("#footPanel").height()-marginHeight);	
	}
	$("#contentArea").height($("#workPanel").height()-$("#tab").height()-3);
	
	setIframe();
	setNav("N");
}

//设置一级TAB内iframe高度、宽度
function setIframe()
{
	var workPanel=g("workPanel");
	var tab=g("tab");
	var workPanelHeight=workPanel.clientHeight;
	var workPanelWidth=workPanel.clientWidth;
	var tabHeight = tab.clientHeight;
	var iframe=workPanel.getElementsByTagName("iframe");
	for(var i=0;i<iframe.length;i++)
	{
		iframe[i].style.height=(workPanelHeight-tabHeight)+"px";
		iframe[i].style.width=(workPanelWidth)+"px";
	}
}

//设置导航区中内容的高度,flag:tree有模块搜索
function setNav(flag)
{
	var marginHeight=3;
	if(flag == "tree")
	{
		$(".search_bar").show();
		$(".dis").height($("#navPanel").height()-$(".title").height()-$(".search_bar").height()-marginHeight);
	}else{
		$(".search_bar").hide();
		$(".dis").height($("#navPanel").height()-$(".title").height()-marginHeight);
	}
}

/************************************ topPanel ************************************/

//一级栏目切换
function HoverMenu(object,subobject)
{
	var tag=g(object).getElementsByTagName(subobject);
	for(var i=0;i<tag.length;i++)
	{
		(function(j){
			tag[j].onclick=function()
			{
				for(var n=0;n<tag.length;n++)
				{
					tag[n].className="";
				}
				tag[j].className="on";
				HoverNav("tree",tag[j].opcode,tag[j].opname);
			}
		})(i);
	}
}

function closeWindow(){
	var prop="dialogHeight:122px; dialogWidth:402px; status:no;unadorned:yes";
	window.showModalDialog("logout.jsp","",prop);
	window.opener=null;
	window.open('','_self');
	window.close();
}
/************************************ searchPanel *********************************/

function chgLoginType()//控制用户登陆类型下拉框
{
	var select_panel = $(".select_panel");
	var select_panel_detail = $(".select_panel p");
	if(select_panel.css("display") == "none"){
		select_panel.css("display","block");
		select_panel_detail.hover(
			function(){
				$(this).css("background-color","#fefe9c");
				this.style.cursor = "hand";
			},
			function(){
			  $(this).css("background-color","");
				this.style.cursor = "point";
		  }
		);
		select_panel_detail.click(function(){
			$("#loginType").val(this.innerText);
			$("#loginType").attr("loginType",this.value);
			$("#phoneNo").val("请输入信息进行查询(Alt+1)");
		});
	}else{
		select_panel.css("display","none");
	}
}

function clearPhoneNo()//清空用户登陆号码
{
	$("#phoneNo").val("");
}

function addTabBySearch()
{
	var tabSize = $("#contentArea iframe").size();
	for(var i=0;i<tabSize;i++)
	{
		if($("#contentArea iframe")[i].id.length>12)
		{
			/********限制只能打开一个客户首页 begin**********
			if($("#contentArea iframe")[i].id.substring(0,12)=="iframecustid")
			{
				showDialog("请办理完当前客户再受理其他客户",1);
				return false;
			}
			********限制只能打开一个客户首页 end************/
		}
	}
	
	var phoneNo = $("#phoneNo").val();
	
	if(phoneNo=="请输入信息进行查询(Alt+1)"||phoneNo=="")
	{
		showDialog("请输入查询条件",1);
		return false;
	}
	
	var loginType = $("#loginType").attr("loginType");
	
	var packet = new AJAXPacket("ajax_getcustid.jsp");
	packet.data.add("phoneNo" ,phoneNo);
	packet.data.add("loginType" ,loginType);
	core.ajax.sendPacket(packet,doGetCustId,true);
	packet =null;
}

function doGetCustId(packet)
{
	var retCode = packet.data.findValueByName("retCode");
	var retMsg = packet.data.findValueByName("retMsg");
	var custIdArr = packet.data.findValueByName("custIdArr");
	var custNameArr = packet.data.findValueByName("custNameArr");
	var loginType = packet.data.findValueByName("loginType");
	var phone_no = packet.data.findValueByName("phone_no");
	

	if(retCode!="000000")
	{
		showDialog(retCode+","+retMsg,0);
		return false;
	}else
	{
		if(custIdArr.length==1)
		{
			openCustMain(custIdArr,custNameArr,loginType,phone_no);
		}else
		{
			var path="selectCustId.jsp?custIdArr="+custIdArr+"&custNameArr="+custNameArr;
			openDivWin(path,'选择客户','600','400');
		}
	}
	
	$("#phoneNo").val("请输入信息进行查询(Alt+1)");
}

function openCustMain(custId,custName,loginType,phone_no)
{
	if($("#contentArea iframe").size() < 11){
		addTab(true,"custid"+custId,custName,'childTab.jsp?gCustId='+custId+'&loginType='+loginType+'&phone_no='+phone_no);
		//window.open('childTab.jsp?gCustId='+custId+'&loginType='+loginType+'&phone_no='+phone_no,"","500","500");
		$("#phoneNo").val("请输入信息进行查询(Alt+1)");
		document.all.phoneNo.blur();
	}else{
		showDialog("只能打开10个一级tab",1);
	}
}

//BEGIN 快速转入
var quickFlag = true;	
var content_array;//快速导航 0: openWay 1:functionCode 2:functionName 3:url 4:passFlag 以空格隔开
var opStr_quick = ""; //系统模块搜索 格式"0121 签退 QT,...."

function initSearch(fuzzyFlag){
	
	//搜索模块
	$("#funcText").focus(function(){
		focusQuickNav(this)
	});
	$("#funcText").blur(function(){
		if($("#funcText").val() == ""){
			$("#funcText").val("搜索模块 (Alt+3)");
		}
	});
	
	
	if(fuzzyFlag){
		//快速转入
		$("#tb").focus(function(){
			focusQuickNav(this)
		});
		$("#tb").blur(function(){
			if($("#tb").val() == ""){
				$("#tb").val("快速转入 (Alt+2)");
			}
		});
	}else{
		//精确搜索
		document.getElementById("tb").style.display = "none";
		document.getElementById("tb_c").style.display = "";
		$("#tb_c").focus(function(){
			focusQuickNav(this)
		});
		$("#tb_c").blur(function(){
			if($("#tb_c").val() == ""){
				$("#tb_c").val("精确搜索(Alt+2)");
			}
		});
	}
}

function focusQuickNav(obj)
{
	if(quickFlag){
		quickFlag = false;
		obj.value="数据加载中...";
		getQuickNavData(obj);
	}else{
 		obj.value="";
	}
}

function getQuickNavData(obj)
{
	var packet = new AJAXPacket("ajax_getquicknav.jsp","请稍后...");
	packet.data.add("objId" ,obj.id);
	core.ajax.sendPacket(packet,doProcessNav,true);//异步
	packet = null;
}

function doProcessNav(packet)
{
  content_array = packet.data.findValueByName("contentStr");
  opStr_quick = packet.data.findValueByName("opStr");
  objId  = packet.data.findValueByName("objId");
  actb(document.getElementById('tb'),document.getElementById('tb_h'),opStr_quick);
  $("#"+objId).val("");
	$("#"+objId).blur();
	$("#"+objId).focus();
}

function quicknav(arr)
{
	if(document.getElementById('tb_h').value!=-1)
	{
		L(arr[0],arr[1],arr[2],arr[3],arr[4]);
	}
}

function turnLock(obj)
{
	if(obj.className=="keyOn")
	{
		document.getElementById('tb').readOnly=true;
		obj.className="key";
		$('#tb').unbind('focus');
	}else{
		document.getElementById('tb').readOnly=false;
		obj.className="keyOn";
		quickFlag = true;
		$('#tb').bind('focus',function(){
			//focusQuickNav(this);
			this.value="";
			actb(document.getElementById('tb'),document.getElementById('tb_h'),opStr_quick);
		});
	}
}
//END 快速转入
///精确搜索
function exactSearch(opValue){
	var opValue = $.trim(opValue).toUpperCase();
	if(opValue == ""){
		 return;
	}else if(opValue.length < 2){
		showDialog("请输入至少两个文字",1,"closeFunc=function(){return;}");
	}
	var isNoFunc = false;
	for(i=0;i<opStr_quick.length-1;i++){
		var temp = opStr_quick[i].split(" ");
		if(opValue==($.trim(temp[0]))||opValue==($.trim(temp[1]))||opValue==($.trim(temp[2]).toUpperCase())){
			isNoFunc = true;
			document.getElementById("tb_c").value =temp[0].concat(" ").concat(temp[1]).concat(" ").concat(temp[2]);
			L(content_array[i][0],content_array[i][1],content_array[i][2],content_array[i][3],content_array[i][4]);
		}
	}
	if(!isNoFunc){
		setTimeout(function(){showDialog("功能不存在，请确认后重新输入",1,"closeFunc=function(){$('#tb_c').focus()}");},10)
	}
}



//导航区切换;
function HoverNav(flag,parentNode,parentName){
	
	//隐藏
	$.each( $(".navMain > div"), function(i, n){
		  $(".navMain > div")[i].className="undis";
	});
	
	$("#wait").show();
	
	if(flag =="fav")
		{
			$("#getFavFunc").addClass("on");
			$("#getTree").removeClass("on");
			$("#getAllTree").removeClass("on");
			$("#getNavFunc").removeClass("on");
			getFavFunc(flag);
		}else if(flag =="tree"){
			$("#getTree").addClass("on");
			$("#getFavFunc").removeClass("on");
			$("#getAllTree").removeClass("on");
			$("#getNavFunc").removeClass("on");
			getTree(parentNode,parentName);
		}else if(flag =="alltree"){
			$("#getAllTree").addClass("on");
			$("#getTree").removeClass("on");
			$("#getFavFunc").removeClass("on");
			$("#getNavFunc").removeClass("on");
			getTree(parentNode,parentName);
		}else{
			$("#getNavFunc").addClass("on");
		  $("#getAllTree").removeClass("on");
			$("#getTree").removeClass("on");
			$("#getFavFunc").removeClass("on");
			getNavFunc();
		}
}

//业务向导展示 20110121
function getNavFunc(){
  var navfunc = document.getElementById("navfunc");
  
  if(navfunc != null)navfunc.parentNode.removeChild(navfunc);
  
	navfunc = document.createElement("div");
	navfunc.setAttribute("className","dis");
	navfunc.setAttribute("id","navfunc");
	navfunc.innerHTML='<iframe id="div_iframe" src="../demo/flowEditors/showdiagram.jsp" width="185" height="600" scrolling="no" frameborder="0"></iframe>';
	//navfunc.innerHTML='<iframe id="div_iframe" src="../demo/guide_nav.jsp" width="185" height="600" scrolling="no" frameborder="0"></iframe>';
		
	$(".navMain")[0].appendChild(navfunc);
	setNav("nav");
	$("#wait").hide();
}

function getFavFunc(nodename)
{ 
	var node_favfunc = document.getElementById("node_favfunc");
	if(node_favfunc == null)
	{
		node_favfunc = document.createElement("div");
		node_favfunc.setAttribute("className","dis");
		node_favfunc.setAttribute("id","node_favfunc");
		$(".navMain")[0].appendChild(node_favfunc);
			
		var packet = new AJAXPacket("ajax_getfavfunc.jsp");
		core.ajax.sendPacketHtml(packet,doGetFavFunc);
		packet =null;
	}else{
		setNav("fav");
		$('#node_favfunc')[0].className="dis";
		$("#wait").hide();
	}
}
 
function doGetFavFunc(data)
{
	setNav("fav");
	$("#wait").hide();
	$('#node_favfunc').html(data);
}

function getTree(parentNode,parentName)
{
	var treenode = document.getElementById("node"+parentNode);
	if(treenode == null)
	{
		treenode = document.createElement("div");
		treenode.setAttribute("className","dis");
		treenode.setAttribute("id","node"+parentNode);
		$(".navMain")[0].appendChild(treenode);
		
		var packet = new AJAXPacket("ajax_gettree.jsp");
		packet.data.add("parentNode" ,parentNode);
		packet.data.add("parentName" ,parentName);
		core.ajax.sendPacketHtml(packet,doGetTree);
		packet =null;
	}else{
		setNav("tree");
		treenode.className="dis";
		$("#wait").hide();
	}
}
 
function doGetTree(data)
{
	setNav("tree");
	$("#wait").hide();
	var currnode ;
	$.each( $(".navMain > div"), function(i, n){
		  if($(".navMain > div")[i].className=="dis")
		  {
		  	currnode=$(".navMain > div")[i].id;
		  	return false;
		  }
	}); 
	$("#"+currnode)[0].className="dis";
	$("#"+currnode).html(data);
}

// 定位树节点（页面导航） 20101221
function getNavById(nodeId,flag,parentNode,parentName){
    HoverNav(flag,parentNode,parentName);
    setTimeout("tree"+parentNode+".focus('"+nodeId+"',true);",20);
} 

function getHotKey()
{
	var packet = new AJAXPacket("ajax_gethotkey.jsp");
	core.ajax.sendPacketHtml(packet,doGetHotKey,true);
	packet =null;
}
	
function doGetHotKey(data)
{
	var hotKeyScript = document.createElement("div");
	hotKeyScript.setAttribute("id","hotKeyScript");
	document.body.appendChild(hotKeyScript);
	$("#hotKeyScript").html(data);
}

function showFavMenu(functionCode)  //展现常用模块右键菜单
{
	var favMenu = document.getElementById('favMenu');//#favMenu在navPanel.jsp中
	
	var  rightedge  =  document.body.clientWidth-event.clientX; 
	var  bottomedge  =  document.body.clientHeight-event.clientY; 
	if  (rightedge  <  favMenu.offsetWidth) 
		favMenu.style.left  =  document.body.scrollLeft  +  event.clientX  -  favMenu.offsetWidth; 
	else 
		favMenu.style.left  =  document.body.scrollLeft  +  event.clientX; 
	if  (bottomedge  <  favMenu.offsetHeight) 
		favMenu.style.top  =  document.body.scrollTop  +  event.clientY  -  favMenu.offsetHeight-45; 
	else 
		favMenu.style.top  =  document.body.scrollTop  +  event.clientY-65; 
	favMenu.style.display  =  "block"; 
	
	activateTab('index');
	
	$('#favMenu #delIcon').bind('click',function(){
		//showDialog("删除常用功能成功",2);
	   delFavfunc(functionCode);
	   //editFavfunc("1","2","0");
	});
	
	$('#favMenu #editIcon').bind('click',function(){
		addTab(true,'index','工作空间','../portal/work/portal.jsp');
		document.getElementById("ifram").contentWindow.openDivWin("<%=request.getContextPath()%>/npage/portal/work/modifyHotKey.jsp","自定义快捷键","400","300");
		hideFavMenu();
		});
		
	$('#favMenu #helpIcon').bind('click',function(){
		callHelp(functionCode)
	});
}
/***********20091015测试使用  begin*************/
function editFavfunc(function_code,op_type,show_order)
{
	var packet = new AJAXPacket("ajax_favfunc_cfm.jsp");
	core.ajax.sendPacket(packet,doFavfunc);
	packet =null;
}
function doFavfunc(packet)
{ 
	var retMsg = packet.data.findValueByName("retMsg");
	showDialog("加入常用功能功能编码："+retMsg,2);
  //getFavFunc();
}

/************end*********************/

$(document).click(function(){
	hideFavMenu();
	
	})

function  hideFavMenu() //隐藏常用模块右键菜单
{
	document.getElementById("favMenu").style.display  =  "none"; 
	//favMenu.style.display  =  "none"; //jyb 注释  document.getElementById("favMenu").style.display  =  "none"; 
	
	
	$('#favMenu #delIcon').unbind('click');
	$('#favMenu #editIcon').unbind('click');
}

var atree = new Array();
	for(var i=0; i<50; i++){
		atree[i] = new Array();
	}
	
	atree[0][0] = "60000"; atree[0][1] = "60001";  atree[0][2] = "DEMO";                 atree[0][3] = "1"; atree[0][4] = "#"; 
	atree[1][0] = "60001"; atree[1][1] = "demo1";  atree[1][2] = "布局管理";             atree[1][3] = "1"; atree[1][4] = "demo/layoutManage.jsp"; 
	atree[2][0] = "60001"; atree[2][1] = "demo2";  atree[2][2] = "风格管理";             atree[2][3] = "1"; atree[2][4] = "demo/styleManage.jsp"; 
	atree[3][0] = "60001"; atree[3][1] = "demo3";  atree[3][2] = "工作区管理";           atree[3][3] = "1"; atree[3][4] = "demo/workPanelManage.jsp"; 
	atree[4][0] = "60001"; atree[4][1] = "demo4";  atree[4][2] = "业务操作向导管理";     atree[4][3] = "1"; atree[4][4] = "demo/flowManage.jsp','000"; 
	atree[5][0] = "60001"; atree[5][1] = "demo5";  atree[5][2] = "业务操作向导模板管理"; atree[5][3] = "1"; atree[5][4] = "demo/flowEditors.jsp"; 
	atree[6][0] = "60001"; atree[6][1] = "demo6";  atree[6][2] = "业务操作向导";         atree[6][3] = "1"; atree[6][4] = "demo/flowEditors/showdiagram.jsp"; 
	atree[7][0] = "60001"; atree[7][1] = "demo7";  atree[7][2] = "页面导航";             atree[7][3] = "1"; atree[7][4] = "demo/pageNavTree.jsp"; 
	atree[8][0] = "60001"; atree[8][1] = "demo8";  atree[8][2] = "消息展现";             atree[8][3] = "1"; atree[8][4] = "demo/message.jsp";
	atree[9][0] = "60001"; atree[9][1] = "demo9";  atree[9][2] = "客户信息视图";         atree[9][3] = "1"; atree[9][4] = "demo/custView.jsp"; 
	atree[10][0]= "60001"; atree[10][1]= "demo32"; atree[10][2]= "界面集成";             atree[10][3]= "1"; atree[10][4]= "demo/integration.jsp"; 
	atree[11][0]= "60001"; atree[11][1]= "demo10"; atree[11][2]= "数据校验";             atree[11][3]= "1"; atree[11][4]= "demo/validate.jsp"; 
	atree[12][0]= "60001"; atree[12][1]= "demo11"; atree[12][2]= "模态框&蒙版&滑框";     atree[12][3]= "1"; atree[12][4]= "demo/MessageDialog.jsp"; 
	atree[13][0]= "60001"; atree[13][1]= "demo12"; atree[13][2]= "分页";                 atree[13][3]= "1"; atree[13][4]= "demo/pageList.jsp"; 
	atree[14][0]= "60001"; atree[14][1]= "demo13"; atree[14][2]= "表格导出";             atree[14][3]= "1"; atree[14][4]= "demo/tableToExcel_new.jsp"; 
	atree[15][0]= "60001"; atree[15][1]= "demo14"; atree[15][2]= "表格排序";             atree[15][3]= "1"; atree[15][4]= "demo/sortTable_demo.jsp"; 
	atree[16][0]= "60001"; atree[16][1]= "demo15"; atree[16][2]= "水印";                 atree[16][3]= "1"; atree[16][4]= "demo/waterMark.jsp"; 
	atree[17][0]= "60001"; atree[17][1]= "demo16"; atree[17][2]= "列值和自计算";         atree[17][3]= "1"; atree[17][4]= "demo/cellsSum.jsp"; 
	atree[18][0]= "60001"; atree[18][1]= "demo17"; atree[18][2]= "图表";                 atree[18][3]= "1"; atree[18][4]= "demo/charts.jsp"; 
	atree[19][0]= "60001"; atree[19][1]= "demo18"; atree[19][2]= "动态树";               atree[19][3]= "1"; atree[19][4]= "demo/stdTree.jsp"; 
	atree[20][0]= "60001"; atree[20][1]= "demo19"; atree[20][2]= "模块关联配置";         atree[20][3]= "1"; atree[20][4]= "demo/moduleRel_m.jsp"; 
	atree[21][0]= "60001"; atree[21][1]= "demo20"; atree[21][2]= "AJAX";                 atree[21][3]= "1"; atree[21][4]= "demo/ajax/ajax.jsp"; 
	atree[22][0]= "60001"; atree[22][1]= "demo21"; atree[22][2]= "RSS";                  atree[22][3]= "1"; atree[22][4]= "demo/rss.jsp"; 
	
	atree[23][0]= "60000"; atree[23][1]= "60002";  atree[23][2]= "其他功能";             atree[23][3]= "1"; atree[23][4]= "#"; 
	atree[24][0]= "60002"; atree[24][1]= "demo22"; atree[24][2]= "cookie";               atree[24][3]= "1"; atree[24][4]= "demo/cookie.jsp"; 
	atree[25][0]= "60002"; atree[25][1]= "demo23"; atree[25][2]= "防拷贝";               atree[25][3]= "1"; atree[25][4]= "demo/nocopy.jsp"; 
	atree[26][0]= "60002"; atree[26][1]= "demo24"; atree[26][2]= "防拷贝配置";           atree[26][3]= "1"; atree[26][4]= "demo/nocopy_m.jsp"; 
	atree[27][0]= "60002"; atree[27][1]= "demo25"; atree[27][2]= "梅花雪静态树";         atree[27][3]= "1"; atree[27][4]= "demo/MzTreeDemo.jsp"; 
	atree[28][0]= "60002"; atree[28][1]= "demo26"; atree[28][2]= "提交失败，信息不丢失"; atree[28][3]= "1"; atree[28][4]= "demo/historyBack.jsp"; 
	atree[29][0]= "60002"; atree[29][1]= "demo27"; atree[29][2]= "查询条件不刷新";       atree[29][3]= "1"; atree[29][4]= "demo/divControl.jsp"; 
	atree[30][0]= "60002"; atree[30][1]= "demo28"; atree[30][2]= "鼠标悬停表格样式";     atree[30][3]= "1"; atree[30][4]= "demo/mouseover.jsp"; 
	atree[31][0]= "60002"; atree[31][1]= "demo29"; atree[31][2]= "自动完成demo";         atree[31][3]= "1"; atree[31][4]= "demo/autoComplete.jsp"; 
	atree[32][0]= "60002"; atree[32][1]= "demo30"; atree[32][2]= "JS跨域";               atree[32][3]= "1"; atree[32][4]= "demo/client.jsp"; 

function addFavfunc(id)//加入常用功能
{ 
	HoverNav('fav');
	var _ul=$(".navMain")[0].children[1].children[0];
	var lis=_ul.children;
	var flag=0;
	for(var i=0; i<lis.length; i++){
	  var existId = lis[i].children[0].innerText.substring(1,lis[i].children[0].innerText.indexOf(']'));
	  if(id==existId){
	      showDialog("加入失败，此功能已存在！",0);
	      flag=1;
	      break;
	  }
	}
	if(flag==0){
	    for(var n=0; n<atree.length; n++){
			     if(atree[n][1]==id){
			     	var li = document.createElement('li');
			     	li.setAttribute('oncontextmenu',function(){javascript:showFavMenu(id);return false;});
			     	var a = document.createElement('a');
			     	a.href="javascript:L('"+atree[n][3]+"','"+id+"','"+atree[n][2]+"','"+atree[n][4]+"','000');";
			     	a.innerText='['+id+']'+atree[n][2];
			     	li.appendChild(a);
			     	 _ul.appendChild(li);
			     	showDialog("加入常用功能成功！",2);
			     	break;
			     }
			 }
	}
	
	
}

function delFavfunc(id)//删除常用功能
{
	var _ul=$(".navMain")[0].children[1].children[0];
	var lis=_ul.children;
	var flag=0;
	for(var i=0; i<lis.length; i++){
	  var existId = lis[i].children[0].innerText.substring(1,lis[i].children[0].innerText.indexOf(']'));
	  if(id==existId){
	      _ul.removeChild(lis[i]);
	      showDialog("删除成功！",0);
	      break;
	  }
	}

}
/************************************ workPanel ************************************/
function callHelp(tabId)//帮助系统
{
	window.open("<%=request.getContextPath()%>/npage/help/help.html");
}

function comment(tabId,opName)//模块评分
{
	var path = "<%=request.getContextPath()%>/npage/public/rating.jsp";
	openDivWin(path,'模块评分','415','204');
}

var g_activateTab = "index";//active tabId
function activateTab(id)
{
	g_activateTab = id;
}

function destroyTab(id)
{
	if(id.substring(0,6)=="custid")
	{
		var sendop_code = {};
		sendop_code["custid"] = id.substring(6,id.length);
		$.ajax({
		   url: 'ajax_destroy.jsp',
		   type: 'POST',
		   data: sendop_code,
		   error: function(data){
				if(data.status=="404")
				{
				  alert( "文件不存在!");
				}else if (data.status=="500")
				{
				  alert("文件编译错误!");
				}else{
				  alert("系统错误!");  					
				}
		   },
		   success: function(retCode){
		   }
		});
		sendop_code=null; 
		}
}

/************************************ footPanel ************************************/

function openwindow(url,name,iWidth,iHeight)
{
  var url;                            //转向网页的地址;
  var name;                           //网页名称，可为空;
  var iWidth;                         //弹出窗口的宽度;
  var iHeight;                        //弹出窗口的高度;
  var iTop  = (window.screen.availHeight-30-iHeight)/2;       //获得窗口的垂直位置;
  var iLeft = (window.screen.availWidth-10-iWidth)/2;           //获得窗口的水平位置;
  var winOP = window.open(url,name,'height='+iHeight+',,innerHeight='+iHeight+',width='+iWidth+',innerWidth='+iWidth+',top='+iTop+',left='+iLeft+',toolbar=no,menubar=no,scrollbars=auto,resizeable=yes,location=no,status=no');
  winOP.focus();     
}
		
/*******************end***************************/	
 	window.onunload=function(){
 	}
 	
 	window.onresize = function(){
		initPanel($("#layoutStatus").val());
	}
	
  /*
	 * 	openflag	 1.first tab;2.second tab;other open
	 *	opcode
	 *	title			 tab show text
	 *	targetUrl  page url
	 *	valideVal	 
	 */
	var isValidateFlag = false;
	
	function L(openflag,opcode,title,targetUrl,valideVal)////L函数与2009-12-19日修改，增加打开方式3，即需要在打开模块前判断，如果客户首页没有打开，就在一级ｔａｂ中打开当前模块，如果客户首页已经打开，就要在二级ｔａｂ中打开当前模块
	{
		try{ // 将打开的业务功能记录到cookie中 add on 20101229
			saveCookieById('op_code_cookie',openflag+' '+opcode+' '+title+' '+targetUrl+' '+valideVal)
		}catch(e){} 
		
		if(openflag=="1")//first tab
		{
			if(targetUrl!="#"){
				targetUrl = changeUrl("<%=request.getContextPath()%>/npage/"+targetUrl,opcode,title);
				if($("#contentArea iframe").size() < 11){
					addTab(true,opcode,title,targetUrl);	
				}else{
					showDialog("只能打开10个一级tab",1);
				}
			}
		}else if(openflag=="2")//second tab
		{
			if(g_activateTab.substr(0,6)=="custid"){
			    //alert(document.getElementById("currUserId").value);
				if($.trim(top.document.getElementById("currUserId").value)=="")return false; //等待客户首页的用户列表加载完毕
				//var  g_activeCustId = g_activateTab.substring(6);
				//targetUrl = changeUrl("<%=request.getContextPath()%>/npage/"+targetUrl,opcode,title);
				//targetUrl = targetUrl+"&activePhone="+g_activateTab; 
				//targetUrl = targetUrl+addCustInfoToUrl(g_activeCustId); 
				document.getElementById("iframe"+g_activateTab).contentWindow.addTab(false,opcode,title,targetUrl);
			}else
			{
				showDialog("请选择要办理的客户!",1);
			}
		}else if(openflag=="3")//如果客户首页已经打开，则打开二级tab，否则打开一级tab
		{
			var  _hasCustOpen = false;
			$("#contentArea iframe").each(function(){
				if($(this)[0].id.length>12&&$(this)[0].id.substring(0,12)=="iframecustid"){
					_hasCustOpen = true;
				}
			});
			
			if(_hasCustOpen){//打开二级tab
				if(g_activateTab.substr(0,6)=="custid"){
					if($.trim(top.document.getElementById("currUserId").value)=="")return false; //等待客户首页的用户列表加载完毕
					var  g_activeCustId = g_activateTab.substring(6);
					targetUrl = changeUrl("<%=request.getContextPath()%>/npage/"+targetUrl,opcode,title);
					//targetUrl = targetUrl+"&activePhone="+g_activateTab; 
					//targetUrl = targetUrl+addCustInfoToUrl(g_activeCustId); 
					document.getElementById("iframe"+g_activateTab).contentWindow.addTab(false,opcode,title,targetUrl);
				}else
				{
					showDialog("请选择要办理的客户!",1);
				}
			}else{  //打开一级tab
				if(targetUrl!="#"){
					targetUrl = changeUrl("<%=request.getContextPath()%>/npage/"+targetUrl,opcode,title);
					if($("#contentArea iframe").size() < 11){
						addTab(true,opcode,title,targetUrl);	
					}else{
						showDialog("只能打开10个一级tab",1);
					}
				}
			}
		}else if(openflag=="4")//一级tab打开集成页面
		{
			if(targetUrl!="#"){
				if($("#contentArea iframe").size() < 11){
					addTab(true,opcode,title,targetUrl);	
				}else{
					showDialog("只能打开10个一级tab",1);
				}
			}
		}
		else//弹出方式
		{
	  	if(targetUrl!="#"){
	  		targetUrl = "<%=request.getContextPath()%>/npage/"+changeUrl(targetUrl,opcode,title);
	  		var win= window.open(targetUrl,"","width="+screen.availWidth+",height="+screen.availHeight+",top=0,left=0,scrollbars=yes,resizable=yes,status=yes");
	  		setTimeout(function(){win.focus();},1000);
	  	}
	  }
	}
	
	/****L函数end*****/
	
	function changeUrl(targetUrl,opCode,title)
	{
  	var flag = targetUrl.indexOf("?");
  	if(parseInt(flag)==-1)
  	{
  		targetUrl=targetUrl+"?opCode="+opCode+"&opName="+title;
  	}else
  	{
  		targetUrl=targetUrl+"&opCode="+opCode+"&opName="+title;
  	}
  	return targetUrl;
	}
	
	function chkIsValidate(validateVal,activePhone,opcode)
	{
	  isValidateFlag = false;
	  var chkInfoPacket = new AJAXPacket("<%=request.getContextPath()%>/npage/public/chkIsValidate.jsp","正在进行用户有效性验证,请稍候...");

    chkInfoPacket.data.add("retType" ,     "chkIsValidate"  );
    chkInfoPacket.data.add("verifyVal" ,  validateVal);
    chkInfoPacket.data.add("phoneNo" ,  activePhone);
    chkInfoPacket.data.add("opCode" ,  opcode);
    core.ajax.sendPacket(chkInfoPacket,doProcesspwd);
    chkInfoPacket =null;
	}
	$(document).ready(
		function(){
			HoverMenu('oli','li');//初始化菜单,绑定一级菜单事件,调用getTree
			HoverNav("fav");

				layoutSwitch(2);		
		

			getHotKey();					//获取快捷键菜单
			initSearch();					//初始化快速入口数据
			$(".more_set").hover(function(){$(this).find(".more_panel").show();$("#moresetIf").height($(this).find(".more_panel").height());},function(){$(this).find(".more_panel").hide()})
		  $(".menu_set").hover(function(){$(this).find(".more_panel").show();$("#menusetIf").height($(this).find(".more_panel").height());},function(){$(this).find(".more_panel").hide()})
			slideDialog("开户模块流程改变，新模块已上线！");
	});
	
	// 关闭当前tab
function removeCurrentTab(){
	
	if(parent.g_activateTab == undefined){
		var l_activateTab = "";
		var lis = parent.document.getElementById('tabtag').getElementsByTagName('li');
		for(var i=0; i<lis.length; i++){
			if(lis[i].className == "current"){
				l_activateTab = lis[i].id;
				break;		        
			} 
		}
		parent.removeTab(l_activateTab);
  }else{
		parent.removeTab(parent.g_activateTab); 
  }
}

function abccc()
{
	alert("ok");
}

//ScreenLock
function fSysLock(){
	$('#lock').css({top:'0'});
	var retInfo = top.window.showModalDialog(globalPathRoot+"npage/login/sysLock.jsp","","status:no;resizable:no;dialogHeight:150px;dialogWidth:500px;");
	while(typeof(retInfo) == "undefined"){
		retInfo = top.window.showModalDialog(globalPathRoot+"npage/login/sysLock.jsp","","status:no;resizable:no;dialogHeight:150px;dialogWidth:500px;");
	}
	//$("body").focus();
	$('#lock').animate({top:'-100%'},1000);
}
</script>

</body>
</html>